package com.ruoyi.common.constant;

/**
 * 通用常量信息
 *
 * @author ruoyi
 */
public interface Constants {

    public static final String PROXY = "";
    public static final String PASSWD = "";
    public static final int TIMEOUT = 5;
    public static final int MAX_RETRY = 3;
    public static final int RETRY_DELAY = 2000;
    public static final boolean IMAGE_COMPRESS_ENABLED = true;
    public static final int MAX_IMAGE_WIDTH = 1920;
    public static final int MAX_IMAGE_HEIGHT = 1080;
    public static final double IMAGE_COMPRESS_QUALITY = 0.8;


    // Redis键常量
    public static final String SYNC_LOCK_KEY = "wecom:msg_archive:sync_lock";
    public static final String USER_INFO_CACHE_KEY = "wecom:user:info:";
    public static final String GROUP_INFO_CACHE_KEY = "wecom:group:info:";
    public static final String MEDIA_FILE_CACHE_KEY = "wecom:media:file:";

    // 缓存时间常量（单位：分钟）
    public static final long USER_INFO_CACHE_TIME = 72L;
    public static final long GROUP_INFO_CACHE_TIME = 72L;
    public static final long MEDIA_FILE_CACHE_TIME = 5L;
    public static final long SYNC_LOCK_TIMEOUT = 3 * 60 * 1000L;



    /**
     * TRUE
     */
    public static final String MINI_APP_SHARE_PAGE = "pages/index/sharePage";

    /**
     * TRUE
     */
    public static final Integer TRUE_1 = 1;

    /**
     * FALSE
     */
    public static final Integer FALSE_0 = 0;

    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "Authorization:login:token:";

    /**
     * 在线用户 redis key
     */
    public static final String ONLINE_TOKEN_KEY = "online_tokens:";


    /**
     * app在线用户 redis key
     */
    public static final String APP_ONLINE_TOKEN_KEY = "app:online_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 限流 redis key
     */
    public static final String RATE_LIMIT_KEY = "rate_limit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 登陆错误 redis key
     */
    public static final String LOGIN_ERROR = "login_error:";

    /**
     * 登录错误次数
     */
    public static final Integer LOGIN_ERROR_NUMBER = 5;

    /**
     * 登录错误限制时间(分钟)
     */
    public static final Integer LOGIN_ERROR_LIMIT_TIME = 10;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    public static final String API_TOKEN = "apiToken";

    public static final String REFRESH_TOKEN = "refresh_token";

    public static final String USER_ID = "user_id";


    public static final String WX_XCY_PHONE_INFO = "phone_info";

    public static final String WX_XCY_PHONE_NUMBER = "phoneNumber";

    public static final String WX_XCY_ERROR_CODE = "errcode";

    public static final String WX_XCY_CODE_PHONE_URL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber";

    public static final String WX_XCY_Q_CODE = "https://api.weixin.qq.com/wxa/getwxacodeunlimit";

    public static final String WX_XCY_ACCESS_TOKEN = "access_token";

    public static final String WX_XCY_CODE = "code";


    public static final String MYBATIS_PLUSH_LIMIT_ONE = "limit 1";


    public static final String USER_DEFAULT_NICKNAME = "微信昵称";

}

